package Cafezam;

import java.util.Scanner;

public class J05Charges {
	public static void main(String[] args)
	{
		Scanner sc=new Scanner(System.in);
		int a=50000,b=10000,c=5000,d=1000,e=500,f=100,g=50,h=10;
		int result1,result2,result3,result4,result5,result6,result7,result8;
		int result;
		int money;
		
		System.out.println("환전받을 액수");
		money=sc.nextInt();
	
		result1=money/a;
		result2=(money%a)/b;
		result3=((money%a)%b)/c;
		result4=(((money%a)%b)%c)/d;
		result5=((((money%a)%b)%c)%d)/e;
		result6=(((((money%a)%b)%c)%d)%e)/f;
		result7=((((((money%a)%b)%c)%d)%e)%f)/g;
		result8=(((((((money%a)%b)%c)%d)%e)%f)%g)/h;
		
		
		
		System.out.println("50000원"+result1+"개");
		System.out.println("10000원"+result2+"개");
		System.out.println("5000원"+result3+"개");
		System.out.println("1000원"+result4+"개");
		System.out.println("500원"+result5+"개");
		System.out.println("100원"+result6+"개");
		System.out.println("50원"+result7+"개");
		System.out.println("10원"+result8+"개");
		
		
		
	}

}
